package org.example.controller;



import com.example.model.system.SysUser;
import org.example.exception.GuiGuException;
import org.example.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/admin/system/sysUser")
@RestController
public class SysUserController {
    @Autowired
    private SysUserService sysUserService;
    @GetMapping("/findAll")
    public List<SysUser> findAll(){
        try {
            int i=10/0;
        }catch (Exception e){
            throw new GuiGuException(20001,"执行了自定义异常处理");
        }

        List<SysUser> list = sysUserService.list();
        return list;
    }
}
